using Microsoft.EntityFrameworkCore;

using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

using Tool;

namespace Abc.Core.Entities
{
    /// <summary>
    /// 邮件发件箱
    /// </summary>
    [Table("EmailSend")]
    [Comment("邮件发送记录")]
    public class EmailSend : FullEntity
    {
        /// <summary>
        /// 类型代码（比如个人邮件、通知邮件）
        /// </summary>
        public string TypeCode { get; set; }

        /// <summary>
        /// 主题
        /// </summary>
        [Comment("主题")]
        public string Subject { get; set; }

        /// <summary>
        /// 内容
        /// </summary>
        [Comment("内容")]
        public string Content { get; set; }

        /// <summary>
        /// 收件人
        /// </summary>
        [Comment("收件人")]
        [MaxLength(200)]
        public string ReceiveName { get; set; }

        /// <summary>
        /// 收件邮箱
        /// </summary>
        [Comment("收件邮箱")]
        [MaxLength(2000)]
        public string ReceiveEmail { get; set; }

        /// <summary>
        /// 发件人
        /// </summary>
        [Comment("发件人")]
        [MaxLength(200)]
        public string SenderName { get; set; }

        /// <summary>
        /// 发件邮箱
        /// </summary>
        [Comment("发件邮箱")]
        [MaxLength(2000)]
        public string SenderEmail { get; set; }

        /// <summary>
        /// 发送状态
        /// </summary>
        [Comment("发送状态")]
        public EmailSendRecordState State { get; set; }

        /// <summary>
        /// 来源ID
        /// </summary>
        [Comment("来源ID")]
        public int? SourceId { get; set; }
    }

    /// <summary>
    /// 邮件发送状态
    /// </summary>
    public enum EmailSendRecordState
    {
        待发送 = 0,
        发送成功 = 1,
        发送失败
    }
}